bool repeatedSubstringPattern(char * s){
   int length=strlen(s);
   int next[length];
   int i;
   int j=0;
   next[0]=0;
   for(i=1;i<length;i++){
       while(j>0&&s[i]!=s[j]){
           j=next[j-1];
       }
       if(s[j]==s[i])
           j++;
       next[i]=j;
   }
   if(next[strlen(s)-1]!=0&&length%(length-next[length-1])==0)
       return true;
   else
       return false;
}
